package cc.mllt.demoaopmybatisauth.demos.web.model.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;

@Data
@TableName("data_permission_rule")
public class DataPermissionRule {

  @TableId(value = "rule_id", type = IdType.AUTO)
  private Integer ruleId;

  private String ruleCode;

  @TableField("rule_target_type")
  private RuleTargetType ruleTargetType; // 使用枚举

  private Integer ruleTargetId;
  private String moduleCode;

  @TableField("data_scope")
  private DataScopeType dataScope; // 使用枚举

  private String dataPermission;
  private Integer ruleWeight;

  @TableLogic(value = "0", delval = "1")
  private Integer delFlag;

  private String status;
  private java.sql.Timestamp createTime;
  private java.sql.Timestamp updateTime;
  private long creatorId;

  private String ruleSql;

  // 枚举定义
  public enum RuleTargetType {
    个人, 角色, 部门
  }

  public enum DataScopeType {
    个人, 角色, 部门
  }

}
